<?php 
class dataUtil
{
	public static function sliceArrayColumn($arr, $colNum)
	{
		$ret = array();
		foreach($arr as $k => $v){
			$ret[$k%$colNum][] = $v;
		}
		
		return $ret;		
	}
	
	public static function getElementByKey($arr, $keys)
	{
		$key_compare_func = create_function('$k1, $k2', '
			if ($k1 == $k2)
	            return 0;
	        else if ($k1 > $k2)
	            return 1;
	        else
	            return -1;
		');
		$keys = array_flip($keys);
    	return array_intersect_ukey($arr, $keys, $key_compare_func);
	}
}

